class Solution {
public:
    int findMaxConsecutiveOnes(vector<int>& nums) {
        int sz=nums.size();
        int left=0,right=0,ret=0;
        while(right<sz)
        {
            while(right<sz&&nums[right]==1)
            {
                right++;
            }
            ret=max(ret,right-left);
            left=++right;
        }
        return ret;
    }
};
